﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OrderingEntities
{
    public partial class _FoodOrders : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_FoodOrders>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _FoodOrders() : base("FoodOrders")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ID = "ID";
        public RaisingStudio.Data.Expressions.ColumnExpression ID { get { return _ID; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _TableNO = "TableNO";
        public RaisingStudio.Data.Expressions.ColumnExpression TableNO { get { return _TableNO; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _KindName = "KindName";
        public RaisingStudio.Data.Expressions.ColumnExpression KindName { get { return _KindName; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _FoodName = "FoodName";
        public RaisingStudio.Data.Expressions.ColumnExpression FoodName { get { return _FoodName; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Price = "Price";
        public RaisingStudio.Data.Expressions.ColumnExpression Price { get { return _Price; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _FoodCount = "FoodCount";
        public RaisingStudio.Data.Expressions.ColumnExpression FoodCount { get { return _FoodCount; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _UserName = "UserName";
        public RaisingStudio.Data.Expressions.ColumnExpression UserName { get { return _UserName; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _CreateTime = "CreateTime";
        public RaisingStudio.Data.Expressions.ColumnExpression CreateTime { get { return _CreateTime; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Comment = "Comment";
        public RaisingStudio.Data.Expressions.ColumnExpression Comment { get { return _Comment; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_FoodOrders FoodOrders)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_FoodOrders FoodOrders)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(FoodOrders);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_FoodOrders FoodOrders)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            FoodOrders.ID,
                            FoodOrders.TableNO,
                            FoodOrders.KindName,
                            FoodOrders.FoodName,
                            FoodOrders.Price,
                            FoodOrders.FoodCount,
                            FoodOrders.UserName,
                            FoodOrders.CreateTime,
                            FoodOrders.Comment,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_FoodOrders>(_FoodOrders FoodOrders)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_FoodOrders>(FoodOrders);
        }


        #region IQueryExpression<_FoodOrders> 成员

        _FoodOrders RaisingStudio.Data.Expressions.IQueryExpression<_FoodOrders>.Value
        {
            get { return FoodOrders._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class FoodOrders
    {
        #region Members
        public static readonly _FoodOrders _ = new _FoodOrders();
		#endregion
    }
}
